import request from '@/router/axios';
//生产设备
//生产设备列表
export const getProEquipmentList = (params) => {
  return request({
    url: '/api/hg-public/produceequipmentlist/findAll',
    method: 'get',
    params: {
      ...params,
    }
  })
}

//根据名称模糊查询生产设备下拉选
export const searchProEquipment = (equipmentName) => {
  return request({
    url: '/api/hg-public/produceequipmentlist/list',
    method: 'get',
    params: {
      equipmentName,
    }
  })
}
//新增生产设备
export const addProEquipment = (row) => {
  return request({
    url: '/api/hg-public/produceequipmentlist/save',
    method: 'post',
    data: row
  })
}

//删除生产设备
export const removeProEquipment = (ids) => {
  return request({
    url: '/api/hg-public/produceequipmentlist/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

//更新生产设备
export const updateProEquipment = (row) => {
  return request({
    url: '/api/hg-public/produceequipmentlist/update',
    method: 'post',
    data: row
  })
}

//获取生产设备详情
export const getProEquipment = (id) => {
  return request({
    url: '/api/hg-public/produceequipmentlist/detail',
    method: 'get',
    params: {
      id,
    }
  })
}

//检测设备
//检测设备列表
export const getCheckEquipmentList = (params) => {
  return request({
    url: '/api/hg-public/testingequipmentlist/findAll',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//新增检测设备
export const addCheckEquipment = (row) => {
  return request({
    url: '/api/hg-public/testingequipmentlist/save',
    method: 'post',
    data: row
  })
}

//根据名称模糊查询检测设备下拉选
export const searchCheckEquipment = (equipmentName) => {
  return request({
    url: '/api/hg-public/testingequipmentlist/list',
    method: 'get',
    params: {
      equipmentName,
    }
  })
}
//删除检测设备
export const removeCheckEquipment = (ids) => {
  return request({
    url: '/api/hg-public/testingequipmentlist/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

//更新检测设备
export const updateCheckEquipment = (row) => {
  return request({
    url: '/api/hg-public/testingequipmentlist/update',
    method: 'post',
    data: row
  })
}

//获取检测设备详情
export const getCheckEquipment = (id) => {
  return request({
    url: '/api/hg-public/testingequipmentlist/detail',
    method: 'get',
    params: {
      id,
    }
  })
}


//模具
//模具列表
export const getMoldList = (params) => {
  return request({
    url: '/api/hg-public/mouldlist/findAll',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//新增模具
export const addMold = (row) => {
  return request({
    url: '/api/hg-public/mouldlist/save',
    method: 'post',
    data: row
  })
}

//根据名称模糊查询模具下拉选
export const searchMold = (equipmentName) => {
  return request({
    url: '/api/hg-public/mouldlist/list',
    method: 'get',
    params: {
      equipmentName,
    }
  })
}
//删除模具
export const removeMold = (ids) => {
  return request({
    url: '/api/hg-public/mouldlist/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

//更新模具
export const updateMold = (row) => {
  return request({
    url: '/api/hg-public/mouldlist/update',
    method: 'post',
    data: row
  })
}

//获取模具详情
export const getMold = (id) => {
  return request({
    url: '/api/hg-public/mouldlist/detail',
    method: 'get',
    params: {
      id,
    }
  })
}


//检具
//检具列表
export const getFixtureList = (params) => {
  return request({
    url: '/api/hg-public/checktoollist/findAll',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//新增检具
export const addFixture = (row) => {
  return request({
    url: '/api/hg-public/checktoollist/save',
    method: 'post',
    data: row
  })
}

//根据名称模糊查询检具下拉选信息
export const searchFixture = (equipmentName) => {
  return request({
    url: '/api/hg-public/checktoollist/list',
    method: 'get',
    params: {
      equipmentName,
    }
  })
}
//删除检具
export const removeFixture = (ids) => {
  return request({
    url: '/api/hg-public/checktoollist/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

//更新检具
export const updateFixture = (row) => {
  return request({
    url: '/api/hg-public/checktoollist/update',
    method: 'post',
    data: row
  })
}

//获取检具详情
export const getFixture = (id) => {
  return request({
    url: '/api/hg-public/checktoollist/detail',
    method: 'get',
    params: {
      id,
    }
  })
}


//工位器具
//工位器具列表
export const getWorkappList = (params) => {
  return request({
    url: '/api/hg-public/workpostoollist/findAll',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//新增工位器具
export const addWorkapp = (row) => {
  return request({
    url: '/api/hg-public/workpostoollist/save',
    method: 'post',
    data: row
  })
}

//根据编号查询工位器具信息
export const searchWorkapp = (equipmentName) => {
  return request({
    url: '/api/hg-public/workpostoollist/list',
    method: 'get',
    params: {
      equipmentName,
    }
  })
}
//删除工位器具
export const removeWorkapp = (ids) => {
  return request({
    url: '/api/hg-public/workpostoollist/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

//更新工位器具
export const updateWorkapp = (row) => {
  return request({
    url: '/api/hg-public/workpostoollist/update',
    method: 'post',
    data: row
  })
}

//获取工位器具详情
export const getWorkapp = (id) => {
  return request({
    url: '/api/hg-public/workpostoollist/detail',
    method: 'get',
    params: {
      id,
    }
  })
}


//初始材料
//初始材料列表
export const getMaterialList = (params) => {
  return request({
    url: '/api/hg-public/rawmateriallist/list',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//获取该项目下的类型为产品的产品下拉选
export const getMaterialProductList = (params) => {
  return request({
    url: '/api/hg-public/rawmateriallist/getProductList',
    method: 'get',
    params: {
      ...params,
    }
  })
}

//根据项目和产品获取初始材料信息
export const getMaterialDetailList = (params) => {
  return request({
    url: '/api/hg-public/rawmateriallist/getMaterialList',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//新增初始材料
export const addMaterial = (row) => {
  return request({
    url: '/api/hg-public/rawmateriallist/save',
    method: 'post',
    data: row
  })
}

//根据编号查询初始材料信息
export const searchMaterial = (equipmentNo) => {
  return request({
    url: '/api/hg-public/rawmateriallist/findWorkPosTool',
    method: 'get',
    params: {
      equipmentNo,
    }
  })
}
//删除初始材料
export const removeMaterial = (ids) => {
  return request({
    url: '/api/hg-public/rawmateriallist/remove',
    method: 'post',
    params: {
      ...ids,
    }
  })
}

//更新初始材料
export const updateMaterial = (row) => {
  return request({
    url: '/api/hg-public/rawmateriallist/update',
    method: 'post',
    data: row
  })
}

//获取初始材料详情
export const getMaterial = (params) => {
  return request({
    url: '/api/hg-public/rawmateriallist/detail',
    method: 'get',
    params: {
      ...params,
    }
  })
}


//辅助材料
//辅助材料列表
export const getAuxMaterialList = (params) => {
  return request({
    url: '/api/hg-public/auxiliarymateriallist/list',
    method: 'get',
    params: {
      ...params,
    }
  })
}

//根据项目和产品获取辅助材料信息
export const getAuxMaterialDetailList = (params) => {
  return request({
    url: '/api/hg-public/auxiliarymateriallist/getMaterialList',
    method: 'get',
    params: {
      ...params,
    }
  })
}

//获取该项目下的类型为产品的产品下拉选
export const getAuxMaterialProductList = (params) => {
  return request({
    url: '/api/hg-public/auxiliarymateriallist/getProductList',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//新增辅助材料
export const addAuxMaterial = (row) => {
  return request({
    url: '/api/hg-public/auxiliarymateriallist/save',
    method: 'post',
    data: row
  })
}

//根据编号查询辅助材料信息
export const searchAuxMaterial = (equipmentNo) => {
  return request({
    url: '/api/hg-public/auxiliarymateriallist/findWorkPosTool',
    method: 'get',
    params: {
      equipmentNo,
    }
  })
}
//删除辅助材料
export const removeAuxMaterial = (ids) => {
  return request({
    url: '/api/hg-public/auxiliarymateriallist/remove',
    method: 'post',
    params: {
      ...ids,
    }
  })
}

//更新辅助材料
export const updateAuxMaterial = (row) => {
  return request({
    url: '/api/hg-public/auxiliarymateriallist/update',
    method: 'post',
    data: row
  })
}

//获取辅助材料详情
export const getAuxMaterial = (params) => {
  return request({
    url: '/api/hg-public/auxiliarymateriallist/detail',
    method: 'get',
    params: {
      ...params,
    }
  })
}


//外委清单
//外委清单列表
export const getOutList = (params) => {
  return request({
    url: '/api/hg-public/outreachlist/list',
    method: 'get',
    params: {
      ...params,
    }
  })
}

//根据项目和产品获取外委清单信息
export const getOutDetailList = (params) => {
  return request({
    url: '/api/hg-public/outreachlist/getOutreachByProductDrawingNo',
    method: 'get',
    params: {
      ...params,
    }
  })
}

//新增外委清单
export const addOut = (row) => {
  return request({
    url: '/api/hg-public/outreachlist/save',
    method: 'post',
    data: row
  })
}

//外委清单负责人下拉选
export const getManager = (params) => {
  return request({
    url: '/api/hg-public/outreachlist/getManager',
    method: 'get',
    params: {
      ...params
    }
  })
}
//删除外委清单
export const removeOut = (ids) => {
  return request({
    url: '/api/hg-public/outreachlist/remove',
    method: 'post',
    params: {
      ...ids,
    }
  })
}

//更新外委清单
export const updateOut = (row) => {
  return request({
    url: '/api/hg-public/outreachlist/update',
    method: 'post',
    data: row
  })
}

//获取外委清单详情
export const getOut = (params) => {
  return request({
    url: '/api/hg-public/outreachlist/detail',
    method: 'get',
    params: {
      ...params,
    }
  })
}


//项目变更清单 
//项目变更清单列表
export const getChangeList = (params) => {
  return request({
    url: '/api/hg-public/projectchangelog/list',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//新增项目变更清单
export const addChange = (row) => {
  return request({
    url: '/api/hg-public/projectchangelog/save',
    method: 'post',
    data: row
  })
}

//删除项目变更清单
export const removeChange = (ids) => {
  return request({
    url: '/api/hg-public/projectchangelog/remove',
    method: 'post',
    params: {
      ids
    }
  })
}

//更新项目变更清单
export const updateChange = (row) => {
  return request({
    url: '/api/hg-public/projectchangelog/update',
    method: 'post',
    data: row
  })
}

//获取项目变更清单详情
export const getChangeDetails = (id) => {
  return request({
    url: '/api/hg-public/projectchangelog/detail',
    method: 'get',
    params: {
      id
    }
  })
}
